<%--
  Created by IntelliJ IDEA.
  User: 箜絔lk
  Date: 2020/9/22
  Time: 20:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-2">
            <form role="form">
                <div class="form-group">
                    <select id='petTypeSelect' class="form-control">
                        <option value="-1">===宠物类型===</option>

                        <c:forEach items="${types}" var="t">
                            <option <c:if test="${typeId==t.id}">selected</c:if> value='${t.id}'>${t.name}</option>
                        </c:forEach>
                    </select>

                </div>
            </form>
        </div>
        <div class="col-md-8">
            <div>
                <form class="bs-example bs-example-form" role="form">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="input-group">
                                <input value='${name}' id='search_input' type="text" class="form-control">
                                <span class="input-group-btn">
                                 <button class="btn btn-default" id='search_btn' type="button">搜索</button>
                                <button type='button' id='more_del_btn' style="margin-left: 5px" class="btn btn-danger">批量删除</button>
                                <button class="btn btn-info" onclick="add()">增加宠物</button>
                             </span>
                            </div><!-- /input-group -->
                        </div><!-- /.col-lg-6 -->
                    </div><!-- /.row -->
                </form>
            </div>
        </div>

    </div>
</div>

<div class="container-fluid" style="margin-top: 50px">
    <div class="table-responsive">
        <table class="table table-hover">
            <caption>宠物信息</caption>
            <thead>
            <tr>
                <th><input id='ck_all' type="checkbox"></th>
                <th>序号</th>
                <th>宠物头像</th>
                <th>宠物名称</th>
                <th>宠物年龄</th>
                <th>出生日期</th>
                <th>操作选项</th>
            </tr>
            </thead>
            <tbody id='tb_pet' class='pet'>

            <c:forEach items="${page.list}" var="p" varStatus="vs">
                <tr>
                    <td><input value='${p.id}' name='ck_content' type="checkbox"></td>
                    <td>${vs.count}</td>
                    <td><img src='http://localhost/pets/imgs/${p.imgUrl}'></td>
                    <td>${p.name}</td>
                    <td>${p.age}</td>

                    <td>${p.birthday}</td>
                    <td><a class="text-danger" href='${path}/pet/del_one?id=${p.id}'><span class="glyphicon glyphicon-trash"></span></a>
                        <button class='btn btn-link' onclick=ajax_del(this,'${p.id}')>异步删除</button>
                        <a class="text-danger" href='${path}/pet/update?id=${p.id}'><span class="glyphicon glyphicon-pencil" onclick="update()"></span></a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>

<%@include file="../common/page02.jsp"%>
<script src="../js/index02.js"></script>

